namespace Test.ConsoleProgram.Algorithm.Solution
{
    [TestDescription("算法: 0096. 不同的二叉搜索树")]
    public class No0096_NumTrees : AbsBaseTestItem
    {
        public override void OnTest()
        {
            Assert.TestExe(NumTrees, 3, 5);
        }

        public int NumTrees(int n)
        {
            long C = 1;
            for (int i = 0; i < n; i++)
            {
                C = C * 2 * (2 * i + 1) / (i + 2);
            }
            return (int)C;
        }
    }
}
